package com.zbs.framework.dao.passport.base.repository;

import com.zbs.framework.dao.passport.entity.MNLoginRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface MNLoginRecordRepository extends JpaRepository<MNLoginRecord, Long> {
    /**
     * 根据uuid和entryType查找登录记录
     * @param uuid
     * @param entryType
     * @return
     */
    MNLoginRecord findByUuidAndEntryType(String uuid, String entryType);

    /**
     * 删除用户所有登录记录
     * @param uuid
     */
    void deleteAllByUuid(String uuid);

    /**
     * 根据token查找登录记录
     * @param token
     * @return
     */
    MNLoginRecord findByToken(String token);
}
